package prototype.shallow;

import java.util.Date;

//原型模式
public class Test {
    public static void main(String[] args) throws CloneNotSupportedException {
        //原型对象
        Date date=new Date();
        Video video1=new Video("骏驰",date);
        System.out.println(video1);

        //克隆对象
        Video video2 = (Video) video1.clone();
        System.out.println(video2);

        System.out.println(video1.hashCode());
        System.out.println(video2.hashCode());

        System.out.println("--------------改变日期--------------");
        date.setTime(323123);
        System.out.println(video1);
        System.out.println(video2);



    }


}
